package org.yty.travelagencymongodb.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.yty.travelagencymongodb.model.Entity.Message;

public interface MessageRepository extends MongoRepository<Message,Long> {
    @Query("{'senderId': ?0, 'receiverId': ?1}")
    Page<Message> findBySenderIdAndReceiverId(Long senderId, Long receiverId, Pageable pageable);

}
